import axiosInstance from '../assets/js/axiosClient'; // 直接导入 axiosInstance
export interface Base {
  _id?: string; // id
  title_cn?: string; // 姓名
  phone?: string; // 电话号码
  mail?: string; // 邮箱地址
  type?: string;
  remark?: string; // 备注
  createTime?: string | Date; // 创建时间，可选
  status?: number; // 状态，可选，默认值为1
}
interface List extends Base {
  pageSize?: number; // 每页条数
  pageIndex?: number; // 当前页码
}


// 新增
export const save = async (params: Base) => {
  const res = await axiosInstance.post('/contacts/save', params)
  return res.data
}
// 列表
export const list = (params: List) => {
  return axiosInstance.get('/contacts', { params: params })
}

// 删除
export const remove = async (params: Base) => {
  const res = await axiosInstance.post('/contacts/delete', params)
  return res.data
}


